.global _start
.org 0x0
_start:
	jal x1,in

.org 0x40
	li x1,0x20000004
	li x2,0x00000000
	lw x2,0x0(x1)
	li x3,0xffffffff
	xor x2,x2,x3
	sw x2,0x0(x1)
	
	li x1,0x50000000
	li x2,0x00000003
	sw x2,0x0(x1)

	mret

.org 0x100
in:
	#亮灯
	li x1,0x20000008
	li x2,0xffffffff
	sw x2,0x0(x1)
	
	li x1,0x2000000c
	li x2,0x00000000
	sw x2,0x0(x1)
	
	li x1,0x20000004
	li x2,0x47404106
	sw x2,0x0(x1)
	
	#设置中断
	li x3,0x40000040
	csrrw x4,mtvec,x3
	
	ecall
stop:	
	wfi
	j stop
